//
//	WkAuthModel.swift
//
//	Create by 松 松 on 21/8/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation
import SSBaseTool

class WkAuthModel : NSObject, NSCoding, SSMap{

	public var appId : String?
	public var body : String?
	public var ip : String?
	public var key : String?
	public var orderId : String?
	public var payState : Int?
	public var sign : String?
	public var totalFee : String?
	public var userId : String?


	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
	required init(fromDictionary dictionary: [String:Any]){
		appId = dictionary["app_id"] as? String
		body = dictionary["body"] as? String
		ip = dictionary["ip"] as? String
		key = dictionary["key_"] as? String
		orderId = dictionary["orderId"] as? String
		payState = dictionary["pay_state"] as? Int
		sign = dictionary["sign"] as? String
		totalFee = dictionary["totalFee"] as? String
		userId = dictionary["userId"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
	func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if appId != nil{
			dictionary["app_id"] = appId
		}
		if body != nil{
			dictionary["body"] = body
		}
		if ip != nil{
			dictionary["ip"] = ip
		}
		if key != nil{
			dictionary["key_"] = key
		}
		if orderId != nil{
			dictionary["orderId"] = orderId
		}
		if payState != nil{
			dictionary["pay_state"] = payState
		}
		if sign != nil{
			dictionary["sign"] = sign
		}
		if totalFee != nil{
			dictionary["totalFee"] = totalFee
		}
		if userId != nil{
			dictionary["userId"] = userId
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required init(coder aDecoder: NSCoder)
	{
         appId = aDecoder.decodeObject(forKey: "app_id") as? String
         body = aDecoder.decodeObject(forKey: "body") as? String
         ip = aDecoder.decodeObject(forKey: "ip") as? String
         key = aDecoder.decodeObject(forKey: "key_") as? String
         orderId = aDecoder.decodeObject(forKey: "orderId") as? String
         payState = aDecoder.decodeObject(forKey: "pay_state") as? Int
         sign = aDecoder.decodeObject(forKey: "sign") as? String
         totalFee = aDecoder.decodeObject(forKey: "totalFee") as? String
         userId = aDecoder.decodeObject(forKey: "userId") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc func encode(with aCoder: NSCoder)
	{
		if appId != nil{
			aCoder.encode(appId, forKey: "app_id")
		}
		if body != nil{
			aCoder.encode(body, forKey: "body")
		}
		if ip != nil{
			aCoder.encode(ip, forKey: "ip")
		}
		if key != nil{
			aCoder.encode(key, forKey: "key_")
		}
		if orderId != nil{
			aCoder.encode(orderId, forKey: "orderId")
		}
		if payState != nil{
			aCoder.encode(payState, forKey: "pay_state")
		}
		if sign != nil{
			aCoder.encode(sign, forKey: "sign")
		}
		if totalFee != nil{
			aCoder.encode(totalFee, forKey: "totalFee")
		}
		if userId != nil{
			aCoder.encode(userId, forKey: "userId")
		}

	}

}
